<?php 
if($ct=="error"){
    echo '<div style="width: 500px;margin:50px auto;">';
    echo "你已经评过了，不能再评，点击返回。<input type='button' value='返回' onclick=\"javascript:location.href='".XXF_HTTP."sjpj';\" >";
    echo '</div>';
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<base href="<?php echo XXF_HTTP?>" />
<meta charset="utf-8">
<title>评教系统</title>
<style type="text/css">
*{margin:0;padding:0;cursor:pointer;}
.xuanxiang:hover{
	background-color:#bbb;
}
</style>
</head>
<body>
<div style="position:fixed; top:0; left: 0;width:100%; height:48px; background:#b5e61d;padding-top:5px;">
	<div style="width:200px;margin:0 auto;color:red;font-weight:bold;">全部教师评完后，点击此按钮提交评价表。<input onclick="sub()" type="button" value="   提  交   "></div>
	
</div>
<div style="width:750px;margin:0px auto;">
	<?php 
	$tm=["仪容仪表","上课迟到、早退","课堂上干别的事，如抽烟、接手机等","课后辅导","课堂纪律管理","关心学生身心健康","讲课的逻辑性","课堂上的遣词用句","上课声音洪亮、口齿清楚","讲课用普通话","板书情况","课前准备情况","批改作业","课堂教学内容安排","上课做到循循善诱、启发学生","是否归纳教学重点和学习方法","上新课时，注意新旧知识的联系","对学生积极性的调动","理论联系实际","专业（学科）知识"];
	$xx=[["大方得体","象个教师","有些随便","不够检点"],["从来没有","极个别现象","有时发生","经常"],["从来没有","偶尔","有几次","多次"],["经常","较经常","一般","很少"],["严格且注意方式","比较.严格","有时也管","放任自流"],["关心","较关心","有时关心","很少关心"],["强","较强","一般","差"],["精妙","较少废话","有点哆嗦","哆嗦，口头语多"],["完全如此","可以听清","勉强听清","听不清"],["标准","较标准","一般","不标准（用方言）"],["工整规范","看得清","还可以","乱七八糟"],["很充分","较充分","不太充分","几无准备"],["及时认真","较认真","大体看一下","不负责任"],["合理","太多","太少","马虎随意"],["好","较好","一般","差"],["是","较少","极少","一次也不"],["非常注意","比较注意","较少注意","完全不复习旧课"],["非常有效","比较有效","一般","完全没有作用"],["紧密","较密切","一般","纯理论"],["扎实深厚","较深厚","一般","肤浅"]];
	$ca=["A","B","C","D"];
	foreach ($ct as $row){
	?>
	<div id="sj_<?php echo $row['tctid']?>" style="padding:5px;width: 100%;border:2px solid #000;margin:50px 5px 50px 5px;">
		<div style="text-align:center;"><h2>学生对教师评教表</h2></div>
		<div>教师姓名：<?php echo $row['tname']?></div>
		<hr>
		<table width="100%">
			<tr>
				<td width="32%" valign="top">
					<div style="width:96%;border:1px solid #aaa;margin:3px;padding:2px;">
						<h4>一、为人师表、关爱学生方面</h4>
						<hr width="90%" style="margin:3px auto;">
						<?php for($i=0;$i<6;$i++){?>
							<div id="st_<?php echo $row['tctid']?>_<?php echo $i?>">
								<h4 style="margin-left:10px;"><?php echo ($i+1).".".$tm[$i]?></h4>
								<?php for($j=0;$j<4;$j++){?>
									<label for="t_<?php echo $row['tctid']?>_<?php echo $i?>_<?php echo $j?>">
										<div class="xuanxiang" style="margin-left:20px;">
											<input onclick="sel('st_<?php echo $row['tctid']?>_<?php echo $i?>')" type="radio" name="t_<?php echo $row['tctid']?>_<?php echo $i?>" id="t_<?php echo $row['tctid']?>_<?php echo $i?>_<?php echo $j?>" >
											<?php echo $ca[$j]." ".$xx[$i][$j]?>
										</div>
									</label>
								<?php }?>
							</div>
						<?php }?>
					</div>
				</td>
				<td width="32%" valign="top">
					<div style="width:96%;border:1px solid #aaa;margin:3px;padding:2px;">
						<h4>二、综合素质、治学态度方面</h4>
						<hr width="90%" style="margin:3px auto;">
						<?php for($i=6;$i<13;$i++){?>
							<div id="st_<?php echo $row['tctid']?>_<?php echo $i?>">
								<h4 style="margin-left:10px;"><?php echo ($i+1).".".$tm[$i]?></h4>
								<?php for($j=0;$j<4;$j++){?>
									<label for="t_<?php echo $row['tctid']?>_<?php echo $i?>_<?php echo $j?>">
										<div class="xuanxiang" style="margin-left:20px;">
											<input onclick="sel('st_<?php echo $row['tctid']?>_<?php echo $i?>')" type="radio" name="t_<?php echo $row['tctid']?>_<?php echo $i?>" id="t_<?php echo $row['tctid']?>_<?php echo $i?>_<?php echo $j?>">
											<?php echo $ca[$j]." ".$xx[$i][$j]?>
										</div>
									</label>
								<?php }?>
							</div>
						<?php }?>
					</div>
				</td>
				<td width="32%" valign="top">
					<div style="width:96%;border:1px solid #aaa;margin:3px;padding:2px;">
						<h4>三、教学方法、理论水平方面</h4>
						<hr width="90%" style="margin:3px auto;">
						<?php for($i=13;$i<20;$i++){?>
							<div id="st_<?php echo $row['tctid']?>_<?php echo $i?>">
								<h4 style="margin-left:10px;"><?php echo ($i+1).".".$tm[$i]?></h4>
								<?php for($j=0;$j<4;$j++){?>
									<label for="t_<?php echo $row['tctid']?>_<?php echo $i?>_<?php echo $j?>">
										<div class="xuanxiang" style="margin-left:20px;">
										<input onclick="sel('st_<?php echo $row['tctid']?>_<?php echo $i?>')" type="radio" name="t_<?php echo $row['tctid']?>_<?php echo $i?>" id="t_<?php echo $row['tctid']?>_<?php echo $i?>_<?php echo $j?>">
										<?php echo $ca[$j]." ".$xx[$i][$j]?>
										</div>
									</label>
								<?php }?>
							</div>
						<?php }?>
					</div>
				</td>
			</tr>
		</table>
		<hr>
		<table width="95%" style="margin:10px auto;">
			<tr>
				<td width="250px;">在右框中填写对 <b><u><?php echo $row['tname']?></u></b> 老师的其他意见和建议。</td>
				<td><input type="text" style="width:100%;height:55px;" id="p_<?php echo $row['tctid']?>"></input></td>
			</tr>
		</table>
	</div>
	<?php }?>
</div>
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery.xxfset.js?r=<?php echo rand()?>"></script>
<script type="text/javascript">
function sub(){
	$radio=$("input[name^='t_']:checked");
	if(($("div[id^='sj_']").length)*20!=$radio.length){
		alert("提交失败，请完成所有选择题后再提交！");
	}else{
		var ca=["A","B","C","D"];
		var cav=[5,4,3,2];
		var jieguo={};
		$radio.each(function(k,v){
			var sp=v.id.split("_");
			jieguo[sp[1]]=(jieguo[sp[1]]?jieguo[sp[1]]:"")+ca[sp[3]];
			jieguo["f"+sp[1]]=(jieguo["f"+sp[1]]?jieguo["f"+sp[1]]:0)+cav[sp[3]];
		});
		var daan="xxf";
		var $text=$("input[id^='p_']");
		$text.each(function(k,v){
			var val=v.value.replace("_","-");
			val=val.replace(",","，");
			jieguo["p"+v.id.split("_")[1]]=val;
		});
		for(e in jieguo){
			if(!isNaN(e)){
				daan+=","+e+"_"+jieguo["f"+e]+"_"+jieguo[e]+"_"+jieguo["p"+e];
			}
		}
		$.xloading(1);
		var tim=setTimeout(function(){
			$.xloading(0);
		},9000);
		var send=function(){
			$.post("sjpj_exam",{
				type:"sub",
				daan:daan
			},function(data){
				$.xloading(0);
				if(data==1){
					//$.xalert("评教成功，感谢你的参与，点击确定返回登陆界面，下一位同学可以继续评教。",function(){
						//location.href="<?php echo XXF_HTTP?>sjpj";
					//});
					alert("评教成功，感谢你的参与，点击确定返回登陆界面，下一位同学可以继续评教。");
					location.href="<?php echo XXF_HTTP?>sjpj";
				}else{
					$.xalert(data);
				}
			}).error(function(){
				send();
			});
		};
		send();
	}
}
function sel(id){
	var ele=document.getElementById(id);
	ele.style.backgroundColor="#b5e61d";
}
</script>
</body>
</html>